<template>
  <tr>
    <td>{{ index }}</td>
    <td>{{ record.created_at }}</td>
    <td>{{ record.height }}</td>
    <td>{{ record.weight }}</td>
    <td>{{ record.bmi }}</td>
    <td>
      <a @click="del" href="javascript:void(0)">删除</a>
    </td>
  </tr>
</template>

<script>
export default {
  // props: ["index", "created_at", "height", "weight", "bmi", "iid"],
  props: {
    record: {
      type: Object,
      default: () => ({})
    },
    index: {
      type: Number,
      required: true
    }
  },
  methods: {
    del() {
      // console.log("删除数据")
      // console.log(this.record)
      this.$emit("delete-item", this.record.id)
    }
  }
}
</script>

<!--
父 -> 子组件： props 自定义属性
子 -> 父组件： $emit 自定义事件
-->



